package org.summer.lawyer.util;

import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.github.yitter.idgen.YitIdHelper;
import lombok.extern.slf4j.Slf4j;

/**
 *
 */
@Slf4j
public class IdWorkerUtil {

    /**
     * 生成ID
     */
    public static Long nextId(){
        try {
            return YitIdHelper.nextId();
        }catch (Exception e){
            log.error("获取ID失败，{}", e.getMessage());
        }
        return IdWorker.getId();
    }

    /**
     * 生成ID
     */
    public static String nextIdStr(){
        return String.valueOf(nextId());
    }
}
